package com.inspinia.base.common.model;

/**
 * Created by veblen on 16/5/20.
 */
public class UserCacheKeys {

    /**
     * 获取用户资源的key
     *
     * @param userId 用户id
     * @return
     */
    public static String getUserResourceKey(Long userId) {
        String key = "user_resource:";
        if (null == userId) {
            return key;
        }
        return key + userId;
    }

//    /**
//     * 生成用户状态的key
//     *
//     * @param userId
//     * @return
//     */
//    public static String genUserLineStatusKey(Long userId) {
//        String key = "user_line_status:";
//        if (null == userId) {
//            return key;
//        }
//        return key + userId;
//    }

    /**
     * 获取用户的菜单缓存key
     *
     * @param userId
     * @return
     */
    public static String getUserMenuKey(Long userId) {
        String key = "user_menus:";
        if (null == userId) {
            return key;
        }
        return key + userId;
    }

    /**
     * 获取用户名和sessionid集合缓存的key
     *
     * @param username
     * @return
     */
    public static String getUsernameSessionKey(String username) {
        return "shiro-kickout:" + username;
    }

    public static String getSessionKey(String username) {
        return "shiro:session:" + username;
    }
}
